package com.appfuse.spring.lab.webapp.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.appfuse.model.BaseObject;

@Entity
@Table(name="adjunto")

	@NamedQueries({
		@NamedQuery(name=Adjunto.NAMED_QUERY_SELECT_USER_FILES, query="SELECT td FROM Adjunto td WHERE td.userName = ?1"),
	})	
public class Adjunto extends BaseObject {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public static final String NAMED_QUERY_SELECT_USER_FILES = "selectUserFiles";
	
	
	protected Long id;
    protected String userName;
    protected String originalFileName;
    protected String fileName;
    protected String contentType;
    protected Date fecha;
    protected byte[] blAdjunto;
    
    @Id @GeneratedValue(strategy = GenerationType.AUTO) 
    public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "user_name", unique = false, nullable = false, insertable = true, updatable = true)	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
    
	@Column(name = "original_file_name", unique = false, nullable = true, insertable = true, updatable = true)
	public String getOriginalFileName() {
		return originalFileName;
	}
	public void setOriginalFileName(String originalFileName) {
		this.originalFileName = originalFileName;
	}
	
	@Column(name = "file_name", unique = false, nullable = true, insertable = true, updatable = true)
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "fecha", unique = false, nullable = true, insertable = true, updatable = true)
	public Date getFecha() {
		return fecha;
	}
	public void setFecha(Date fecha) {
		this.fecha = fecha;
	}
	
	@Column(name = "content_type", unique = false, nullable = true, insertable = true, updatable = true)
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	
	@Lob
	@Column(name = "blAdjunto", unique = false, nullable = true, insertable = true, updatable = true)	
	public byte[] getBlAdjunto() {
		return blAdjunto;
	}
	public void setBlAdjunto(byte[] blAdjunto) {
		this.blAdjunto = blAdjunto;
	}
	
	@Override
	public boolean equals(Object arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	
	
    

}
